﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Minesweeper.Test
{
    public class StringConverter
    {

        public string[] Convert(int[,] SolvedPlan, int Dimension)
        {
            if (SolvedPlan.Length == 0)
            {
                return new string[SolvedPlan.GetUpperBound(1) + 1];
            }

            var ResultArray = new string[Dimension];
            var ResultString = "";

            for (int PosY = 0; PosY <= SolvedPlan.GetUpperBound(1); PosY++)
            {
                for (int PosX = 0; PosX < SolvedPlan.GetUpperBound(0) + 1; PosX++)
                {
                    ResultString += SolvedPlan[PosX, PosY].ToString();
                }
                ResultArray[PosY] = ResultString;
                ResultString = "";
            }
            return ResultArray;
        }
    }
}
